package cn.com.yang.datastruct.graph;

/**
 * 深度优先搜索DFS-栈的实现
 * TODO
 * @author yangyijin
 * @since 2024年2月6日-下午5:44:45
 */
public class StackX {
	private final int SIZE=20;
	private int[] st;
	private int top;
	public StackX() {
		st = new int[SIZE];
		top=-1;
	}
	public void push(int i) {
		st[++top]=i;
	}
	public int pop() {
		return st[top--];
	}
	public int peek() {
		return st[top];
	}
	public boolean isEmpty() {
		return top==-1;
	}
}
